# defines for build #
CXX_DEFINES:=
# compiler #
CXX:=g++
CXXFLAGS:=-I ./include -nostdlib -fno-rtti -fno-exceptions -Wall
# linker #
LD:=ld
LDFLAGS:=
OUTPUT:=test.m
CC_SRCS:=$(shell find -mindepth 1 -maxdepth 3 -name "*.cc")
OBJS:=$(patsubst %.cc,%.o,$(CC_SRCS))

default: $(OUTPUT)
	@echo --Compiling Sandpile--

$(OUTPUT): $(OBJS)
	$(LD) $(LDFLAGS) -o $(OUTPUT) *.o
	#@strip $(OUTPUT)

%.o: %.cc
	$(CXX) $(CXX_DEFINES) $(CXXFLAGS) -c $<

install:
	@echo --Installing Modules:Sandpile--
	cp $(OUTPUT) $(TARGETDIR)/modules/boot/$(OUTPUT)
